home *** CD-ROM | disk | FTP | other *** search
/ Openstep 4.2 (Developer) / Openstep Developer 4.2.iso / NextDeveloper / Source / GNU / uucp / Uucp.framework / unix.subproj / time.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-10-09  |  634 b   |  33 lines

  1. /* time.c
  2.    Get the current time.  */
  3.  
  4. #include "uucp.h"
  5.  
  6. #if HAVE_TIME_H
  7. #include <time.h>
  8. #endif
  9.  
  10. #include "system.h"
  11.  
  12. #ifndef time
  13. extern time_t time ();
  14. #endif
  15.  
  16. /* Get the time in seconds since the epoch, with optional
  17.    microseconds.  We use ixsysdep_process_time to get the microseconds
  18.    if it will work (it won't if it uses times, since that returns a
  19.    time based only on the process).  */
  20.  
  21. long
  22. ixsysdep_time (pimicros)
  23.      long *pimicros;
  24. {
  25. #if HAVE_GETTIMEOFDAY || HAVE_FTIME
  26.   return ixsysdep_process_time (pimicros);
  27. #else
  28.   if (pimicros != NULL)
  29.     *pimicros = 0;
  30.   return (long) time ((time_t *) NULL);
  31. #endif
  32. }
  33.